<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black" />
		<meta name="format-detection" content="telephone=no" />
		<title>验证码发送测试</title>
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
		<script src="${basepath!}/plugin/layer/layer.js"></script>
		<script src="${basepath!}/plugin/hhYzm/yzm.js"></script>
	</head>

	<body style="margin-left: 5px; margin-right: 5px">
		<div style="margin-top: 15px">
			<div class="panel panel-success">
				<div class="panel-heading">
					<h3 class="panel-title">手机 验证码 +图片校验</h3>
				</div>
				<div class="panel-body">

					<div class="input-group">
						<input type="text" name="username" id="username" class="form-control" placeholder="请输入手机号码注册" data-bv-field="username">
						<div class="input-group-btn">
							<button type="button" class="btn btn-default get_yzm">获取验证码</button>
						</div>
					</div>
					<br/>
					<div class="input-group">
						<input type="text" name="username" id="vercode" class="form-control" placeholder="请输入手机号码注册" data-bv-field="username">
						<div class="input-group-btn">
							<button type="button" class="btn btn-default post_data">开始提交</button>
						</div>
					</div>

				</div>
			</div>
			<script type="text/javascript">
				$(function() {
					// 获取验证码
					$(".get_yzm").YzmProc({
						elm: "#username",
						url: "/api/ver/code/getVerCode?phone={{phone}}&token={{token}}&code={{code}}",
						safe: "/api/ver/getVerImg",
						duration: 60
					});
					$(".post_data").click(function() {
						if($("#username").val() == "" || $("#vercode").val() == "") {
							layer.msg("参数不能为空@");
							return;
						}
						$.ajax({
							type: "get",
							url: "/api/ver/code/save_check?phone="+$("#username").val()+"&vercode="+$("#vercode").val(),
							dataType: "json",
							success: function(d) {
								layer.msg(d.msg);
							}
						});
					})

				})
			</script>
	</body>

</html>